//
//  MyConsole.swift
//  frp-tool
//
//  Created by 傅攀 on 2019/11/19.
//  Copyright © 2019 傅攀. All rights reserved.
//

import Foundation
import Cocoa

class MyConsole: NSObject {
    
    let console:NSTextView
    
    
    init(textField: NSTextView){
        self.console=textField
    }
    
    
    func log(text: String){
        
      //  console.stringValue = console.stringValue + "[INFO] " + text + "\n"
        console.string = console.string + "[INFO] " + text + "\n"
       //  console.scrollToEndOfDocument(self)
    }
    
    func error(text: String){
       // console.stringValue = console.stringValue + "[ERROR] " + text + "\n"
        console.string = console.string + "[ERROR] " + text + "\n"
       //  console.scrollToEndOfDocument(self)
    }
    
    func warn(text: String){
        //console.stringValue = console.stringValue + "[WARN] " + text + "\n"
        console.string = console.string + "[WARN] " + text + "\n"
        //console.scrollToEndOfDocument(self)
    }

}
